﻿<div class="with-progress" data-bind="spinner: spinner">
    <p data-bind="visible: blobs().length == 0">
        No blobs found matching your criteria.
    </p>
    <table class="data" data-bind="visible: blobs().length > 0">
        <thead>
            <tr>
                <th class="name">Name</th>
                <th class="blobType">Type</th>
                <th class="contentType">Mime Type</th>
                <th class="contentLength">Length</th>
                <th class="lease">Lease</th>
                <th class="actions"></th>
            </tr>
        </thead>
        <tbody data-bind="foreach: pager.items">
            <tr>
                <td>
                    <a href="javascript:void(0)" data-bind="text: name, title: name, href: $parent.getViewUrl($data), attr: {target: type() == 'PageBlob' ? '_self' : '_blank'}">view</a>
                </td>
                <td data-bind="text: blobType, title: blobType"></td>
                <td data-bind="text: contentType, title: contentType"></td>
                <td data-bind="text: formattedLength, title: formattedLength"></td>
                <td data-bind="css: { locked: locked(), unlocked: !locked() }">
                    <a href="javascript:void(0)" title="unlock" class="unlock" data-bind="click: $parent.unlockBlob"></a>
                    <span class="unlock">locked</span>
                    <a href="javascript:void(0)" title="lock" class="lock" data-bind="click: $parent.lockBlob"></a>
                    <span class="lock">unlocked</span>
                </td>
                <td>
                    <a href="javascript:void(0)" data-bind="modalOpen: 'manageLease', click: function () { $parents[1].leaseDetails.forBlob($parent.container(), $data) }">lease</a>
                    <a href="javascript:void(0)" data-bind="modalOpen: 'blobDetails', click: $parents[1].blobDetails.init">details</a>

                    <a data-bind="href: $parent.getDownloadUrl($data)">download</a>
                    <a href="javascript:void(0)" data-bind="modalOpen: 'deleteBlob', click: $parents[1].deleteBlobDetails.init">delete</a>
                </td>
            </tr>
        </tbody>
    </table>
</div>
